package com.bestcem.xm.member.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import org.springframework.stereotype.Component;

import java.util.LinkedList;
import java.util.List;

/**
 * @author dc.wang <dc.wang@idiaoyan.com>
 * @version V1.0
 * @description TODO
 * @date 2021/8/24
 */
@Component
public class EasyExcelListener<T> extends AnalysisEventListener<T>{
    private List<T> data = new LinkedList<>();

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

    @Override
    public void invoke(T t, AnalysisContext analysisContext) {
        data.add(t);
    }

    public List<T> getResult(){
        return data;
    }
}
